package core;

import javax.swing.SwingUtilities;

import gui.Window;

public class Controler {
	
	private Window window;
	private Clock clock;
	
	public Controler() {
	}
	
	public Controler(Window window, Clock clock) {
		this.window = window;
		this.clock = clock;
	}
	
	public void killclock() {
		clock.setStop(true);
	}
	
	public void updateWindow(String time) {
		window.setTextField(time);
	}
	
	public void runClock() {			
		clock = new Clock(this);
		Thread worker = new Thread(clock);
		worker.start();
	}
	
	public static void main(String[] args) {
		Clock clock = new Clock();
		Window window = new Window();
		Controler controler = new Controler(window, clock);
		window.setControler(controler);
		clock.setControler(controler);
	}
}
